package com.suixun.util.enums;

public enum RedisKeyEnum {

	/**
	 * 首页刚刚喜欢
	 * 
	 * @type sortset
	 */
	INDEX_FAVOR_PRODUCT("index:favor:product", 30 * 24 * 60 * 60),

	/**
	 * 主题创建次数
	 */
	ANTISPIDER_TOPIC_CREATE("antiSpider:topic:create", 30 * 24 * 60 * 60),

	/**
	 * 首页标签推广
	 */
	INDEX_TAG_PROMOTION("index:tag:promotion:{0}", 30 * 24 * 60 * 60),

	// message
	/**
	 * 未读粉丝消息数 {0} = userId
	 * 
	 * @type hashmap
	 */
	MESSAGE_USER_UNREAD_FANS("u:{0}:ur", "fans", 30 * 24 * 60 * 60),

	/**
	 * 一个内用户发送消息计数 {0} = userId
	 * 
	 * @type hashmap
	 */
	MESSAGE_USER_SEND_COUNT("u:{0}:send", "fans", 24 * 60 * 60),

	/**
	 * 未读评论数 {0} = userId
	 * 
	 * @type hashmap
	 */
	MESSAGE_USER_UNREAD_COMMENTS("u:{0}:ur", "comment", 30 * 24 * 60 * 60),

	/**
	 * 未读回复数 {0} = userId
	 * 
	 * @type hashmap
	 */
	MESSAGE_USER_UNREAD_REPLY("u:{0}:ur", "reply", 30 * 24 * 60 * 60),

	/**
	 * 未读@数 {0} = userId
	 * 
	 * @type hashmap
	 */
	MESSAGE_USER_UNREAD_AT("u:{0}:ur", "at", 30 * 24 * 60 * 60),

	/**
	 * 未读私信数 {0} = userId
	 * 
	 * @type hashmap
	 */
	MESSAGE_USER_UNREAD_PM("u:{0}:ur", "pm", 30 * 24 * 60 * 60),

	/**
	 * 未读喜欢宝贝 {0} = userId
	 * 
	 * @type hashmap
	 */
	MESSAGE_USER_UNREAD_XIHUAN("u:{0}:ur", "xihuan", 30 * 24 * 60 * 60),

	/**
	 * 未读喜欢搭配 {0} = userId
	 * 
	 * @type hashmap
	 */
	MESSAGE_USER_UNREAD_XIHUAN_DAPEI("u:{0}:ur", "xihuan_dapei",
			30 * 24 * 60 * 60),

	/**
	 * 未读关注 {0} = userId
	 * 
	 * @type hashmap
	 */
	MESSAGE_USER_UNREAD_INTEREST("u:{0}:ur", "interest", 30 * 24 * 60 * 60),

	/**
	 * 未读系统消息 {0} = userId
	 * 
	 * @type hashmap
	 */
	MESSAGE_USER_UNREAD_SYS("u:{0}:ur", "system", 30 * 24 * 60 * 60),

	/**
	 * 未读鉴定数 {0} = userId
	 * 
	 * @type hashmap
	 */
	MESSAGE_USER_UNREAD_JD("u:{0}:ur", "jd", 30 * 24 * 60 * 60),

	/**
	 * 已读消息 {0} = userId
	 * 
	 * @type list
	 */
	MESSAGE_USER_READ("u:{0}:msg:r", 30 * 24 * 60 * 60),

	/**
	 * 个人已读公共消息(供获取未读公共信息用) {0} = userId
	 * 
	 * @type set
	 */
	MESSAGE_USER_READ_PUBLIC("msg:{0}:pub", 30 * 24 * 60 * 60),

	/**
	 * 公共消息
	 * 
	 * @type set
	 */
	MESSAGE_PUBLIC("msg:pub", 30 * 24 * 60 * 60),

	/**
	 * 个人已读公共消息(供获取未读公共信息用) {0} = messageId
	 * 
	 * @type hash
	 */
	MESSAGE_ENTITY("msg:{0}", 30 * 24 * 60 * 60),

	// message end

	/**
	 * 未读好友逛数 {0} = userId
	 * 
	 * @type value
	 */
	MESSAGE_USER_UNREAD_FEEDS("u:{0}:ur:feeds", 30 * 24 * 60 * 60),

	/**
	 * 读取好友逛数的时间 {0} = userId
	 * 
	 * @type value
	 */
	MESSAGE_USER_READ_FEEDS_TIME("u:{0}:ur:feeds:lastread", 30 * 24 * 60 * 60),

	/**
	 * product_mapper
	 * 
	 * @type hashmap
	 */
	PRODUCT_MERGE_MAPPER("p:merge:mapper", 30 * 24 * 60 * 60),

	/**
	 * 讨论组编辑器视频 key:MD5(swf地址) value: name#*,*#缩略图地址 #*,*#为分隔符
	 * 
	 * @type hashmap
	 */
	FORUM_EDITOR_VIDEO("forum:editor:{0}", 30 * 24 * 60 * 60),

	// 用户维度cache

	/**
	 * 用户level
	 * 
	 * @type hashmap
	 * @since Guang 1.0-SNAPSHOT
	 */
	USER_LEVEL("user:{0}", "level", 30 * 24 * 60 * 60),

	/**
	 * 用户粉丝
	 * 
	 * @type hashmap
	 * @since Guang 1.0-SNAPSHOT
	 */
	USER_FANS("user:{0}", "fans", 30 * 24 * 60 * 60),

	/**
	 * 用户关注
	 * 
	 * @type hashmap
	 * @since Guang 1.0-SNAPSHOT
	 */
	USER_FOLLOW("user:{0}", "follow", 30 * 24 * 60 * 60),

	/**
	 * 用户品牌
	 * 
	 * @type hashmap
	 * @since Guang 1.0-SNAPSHOT
	 */
	USER_BRAND("user:{0}", "brand", 30 * 24 * 60 * 60),

	/**
	 * 用户场景
	 * 
	 * @type hashmap
	 * @since Guang 1.0-SNAPSHOT
	 */
	USER_SCENE("user:{0}", "scene", 30 * 24 * 60 * 60),

	/**
	 * 用户创建的主题
	 * 
	 * @type hashmap
	 * @since Guang 1.0-SNAPSHOT
	 */
	USER_TOPIC_MY("user:{0}", "topic_my", 30 * 24 * 60 * 60),

	/**
	 * 用户喜欢的主题
	 * 
	 * @type hashmap
	 * @since Guang 1.0-SNAPSHOT
	 */
	USER_TOPIC_LIKE("user:{0}", "topic_like", 30 * 24 * 60 * 60),

	/**
	 * 用户发布的商品
	 * 
	 * @type hashmap
	 * @since Guang 1.0-SNAPSHOT
	 */
	USER_PRODUCT_MY("user:{0}", "product_my", 30 * 24 * 60 * 60),

	/**
	 * 用户喜欢的商品
	 * 
	 * @type hashmap
	 * @since Guang 1.0-SNAPSHOT
	 */
	USER_PRODUCT_LIKE("user:{0}", "product_like", 30 * 24 * 60 * 60),

	/**
	 * 用户动态
	 * 
	 * @type hashmap
	 * @since Guang 1.0-SNAPSHOT
	 */
	USER_FEEDS("user:{0}", "feeds", 30 * 24 * 60 * 60),

	/**
	 * 用户昵称
	 * 
	 * @type hashmap
	 * @since Guang 1.0-SNAPSHOT
	 */
	USER_NAME("user:{0}", "name", 30 * 24 * 60 * 60),

	/**
	 * 用户位置
	 * 
	 * @type hashmap
	 * @since Guang 1.0-SNAPSHOT
	 */
	USER_LOCATION("user:{0}", "location", 30 * 24 * 60 * 60),

	/**
	 * 用户描述
	 * 
	 * @type hashmap
	 * @since Guang 1.0-SNAPSHOT
	 */
	USER_DESC("user:{0}", "desc", 30 * 24 * 60 * 60),

	/**
	 * 用户性别
	 * 
	 * @type hashmap
	 * @since Guang 1.0-SNAPSHOT
	 */
	USER_SEX("user:{0}", "sex", 30 * 24 * 60 * 60),

	// Cache reload
	/**
	 * Cache reload list
	 * 
	 * @type hashmap
	 * @since Guang 1.0-SNAPSHOT
	 */
	CACHE_RELOAD("cache:reload", null, 30 * 24 * 60 * 60),

	/**
	 * 被动cache reload
	 * 
	 * @type key-value
	 * @since Guang 1.0-SNAPSHOT
	 */
	CACHE_PASSIVE_RELOAD("cache:{0}", 1000 * 30 * 24 * 60 * 60),

	/**
	 * 发现页评论开发
	 * 
	 * @type String "open" 当cache取不到的时候去db取 "close" 只从cache里面取(default)
	 */
	CACHE_FAXIAN_OFFSET("cache:faxian:offset", 30 * 24 * 60 * 60),

	/**
	 * 商品最新评论
	 * 
	 * @type hashmap
	 * @since Guang 1.0-SNAPSHOT
	 */
	CACHE_COMMENT_LATEST("cache:comment", null, 30 * 24 * 60 * 60),

	/**
	 * ipad 标签订阅数 hashKey galleryId:tagId
	 */
	IPAD_SUB_TAG("subscribe_tag_count", "{0}:{1}", 30 * 24 * 60 * 60),

	/**
	 * anti-spam log
	 * 
	 * @type zset
	 * @since Guang 1.0-SNAPSHOT
	 */
	LOG_IP("log:ip:{0}:{1}", 12 * 60 * 60),

	/**
	 * anti-spam log
	 * 
	 * @type zset
	 * @since Guang 1.0-SNAPSHOT
	 */
	LOG_USER("log:user:{0}:{1}", 12 * 60 * 60),

	/**
	 * anti-spam log
	 * 
	 * @type zset
	 * @since Guang 1.0-SNAPSHOT
	 */
	LOG_TBK("log:tbk:{0}:{1}", 12 * 60 * 60),

	/**
	 * anti-spam log
	 * 
	 * @type zset
	 * @since Guang 1.0-SNAPSHOT
	 */
	LOG_IP_COUNT("log:ip:count:{0}:{1}", 12 * 60 * 60),

	/**
	 * anti-spam log
	 * 
	 * @type zset
	 * @since Guang 1.0-SNAPSHOT
	 */
	LOG_USER_COUNT("log:user:count:{0}:{1}", 12 * 60 * 60),

	/**
	 * anti-spam log
	 * 
	 * @type zset
	 * @since Guang 1.0-SNAPSHOT
	 */
	LOG_TBK_COUNT("log:tbk:count:{0}:{1}", 12 * 60 * 60),

	/**
	 * 白名单 user
	 * 
	 * @type set
	 * @since Guang 1.0-SNAPSHOT
	 */
	WHITE_LIST_USER("whitelist:user", 365 * 24 * 60 * 60),
	/**
	 * 白名单 ip
	 * 
	 * @type set
	 * @since Guang 1.0-SNAPSHOT
	 */
	WHITE_LIST_IP("whitelist:ip", 365 * 24 * 60 * 60),

	/**
	 * 机器人用户ID
	 * 
	 * @type set
	 * @since Guang 1.0-SNAPSHOT
	 */
	ROBOT_USER_ID("robot_user_id", 3 * 365 * 24 * 60 * 60),

	/**
	 * 机器人用户淘宝客ID
	 * 
	 * @type set
	 * @since Guang 1.0-SNAPSHOT
	 */
	ROBOT_USER_TBK_ID("robot_user_tbk_id", 3 * 365 * 24 * 60 * 60),

	/**
	 * 可疑用户
	 * 
	 * @type key-value
	 * @since Guang 1.0-SNAPSHOT
	 */
	SUSPECT_USER("suspect:user:{0}:type:{1}", 365 * 24 * 60 * 60),

	/**
	 * 可疑淘宝客
	 */
	SUSPECT_TBK("suspect:tbk:{0}:type:{1}", 365 * 24 * 60 * 60),
	/**
	 * 可疑IP
	 * 
	 * @type key-value
	 * @since Guang 1.0-SNAPSHOT
	 */
	SUSPECT_IP("suspect:ip:{0}:type:{1}", 365 * 24 * 60 * 60),

	USER_PUBLISH_PRODUCTDS("user_p_pro_{0}", 365 * 24 * 60 * 60),

	DAPEI_MESSAGE("dapei_msg_{0}_{1}", 24 * 60 * 60),

	DAREN_MESSAGE("daren_msg_{0}_{1}", 24 * 60 * 60),

	PRODUCT_SUMMARY_CACHE("productSummaryCachedTimeMap", "productSummary:{0}",
			24 * 60 * 60);

	private String key;

	/**
	 * hashmap类型 生效
	 * 
	 * @since Guang 1.0-SNAPSHOT
	 */
	private String hashKey;
	private int expiredTime;

	private RedisKeyEnum(String key, int expiredTime) {
		this.key = key;
		this.expiredTime = expiredTime;
	}

	private RedisKeyEnum(String key, String hashKey, int expiredTime) {
		this.key = key;
		this.hashKey = hashKey;
		this.expiredTime = expiredTime;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public int getExpiredTime() {
		return expiredTime;
	}

	public void setExpiredTime(int expiredTime) {
		this.expiredTime = expiredTime;
	}

	public String getHashKey() {
		return hashKey;
	}

	public void setHashKey(String hashKey) {
		this.hashKey = hashKey;
	}

}
